#pragma once

#include "hugin"
#include <map>
#include <list>
#include <hash_map>
#include <iostream>

using namespace std;
using namespace stdext;

class PolicyFileParser
{
public:	
	PolicyFileParser::PolicyFileParser();
	PolicyFileParser::PolicyFileParser(string policyFiles, string fileExtension, bool preloadFiles, string actionPrefix);
	string  DecisionFromObservation(int timeStep, string observation, string opponentAction);
	int PolicyFileParser::GetNumberOfFilesInFolder(string folderDir, string fileExtension);
	string PolicyFileParser::GetCurrDirectory();
	int PolicyFileParser::GetNumerOfTimeSteps();

private:
	string _actionPrefix;
	string _observationPrefix;
	string _enemyActionPrefix;

	string _policyFilesDir;
	string _fileExtension;
	string _searchString;

	hash_map<string, string> _previousActObs;
	hash_map<string, hash_map<string, string>> _policies;
	hash_map<string, list<string>> _parents;

	list<string> PolicyFileParser::ParseTextFile(string inputFile);
	list<string> PolicyFileParser::GetParentNamesFromFile(list<string> inputStrings);
	string PolicyFileParser::GetActionNodeFileNameFromTimeStep(int timeStep);
	void PolicyFileParser::PreloadedFiles();
};

